<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:shiro="http://shiro.apache.org/tags"
	xmlns:pe="http://primefaces.org/ecuador">
	<c:forEach var="menu" items="#{items}">
		<c:choose>
			<c:when test="#{menu.parent == null and menu.children.size() > 0}">
				<p:submenu id="om_#{menu.code}" label="#{menu.name}"
					icon="fa fa-#{menu.icon}">
					<ui:include src="./menu_item.xhtml">
						<ui:param name="items" value="#{menu.children}" />
					</ui:include>
				</p:submenu>
			</c:when>
			<c:otherwise>
				<shiro:hasPermission name="#{menu.permission}">
					<p:menuitem rendered="#{menu.type == 'MENU'}" id="om_#{menu.code}"
						url="#{facesContext.externalContext.requestContextPath}#{menu.url}.faces"
						value="#{menu.name}" icon="fa fa-#{menu.icon}" />
				</shiro:hasPermission>
			</c:otherwise>
		</c:choose>
	</c:forEach>
</ui:composition>